xl: Command line: Adjust "Fix segfaults from `xl psr-cat-cbm-set`..."
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 17 Jul 2015 17:00:47 +0000 (18:00 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 21 Jul 2015 15:03:16 +0000 (16:03 +0100)
commite424bff91b067e0d1e8eb8f8efa38f63c822c5b2
tree64a2110262be37f1aed98a136584b8d6f12cd353
parent1287ac109c44ca9b99eb642316d7af83b4081b52
xl: Command line: Adjust "Fix segfaults from `xl psr-cat-cbm-set`..."

This adjust commit a49077e5 "Fix segfaults from `xl psr-cat-cbm-set`
command line handling":

 * Do not use the constant `required_argument' here (we simply use 1
   everywhere else).

 * Fix the minimum required arguments argument to SWITCH_FOREACH_OPT.

Leave the separate check on optind, because it checks for too many as
well as too few arguments.

(There are many things in xl which fail to check for too many
arguments.  I do not intend to drain that swamp now: I started but
decided a complete overhaul of most of xl's command line argument
processing would be best.)

This is just a code cleanup with no ultimate functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Chao Peng <chao.p.peng@linux.intel.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/xl_cmdimpl.c